<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<!-- <meta http-equiv="refresh" content="2" /> -->
	<title>所有图片查看</title>
	<!--[if lt IE 9]>
		<script src="<%=basePath %>js/ie9.js"></script>
	<![endif]-->
	<link rel="icon" href="<%=basePath %>images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<%=basePath %>images/favicon.ico" type="image/x-icon" />
	<script src="<%=basePath %>js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/jquery.cookie.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/cookie.save.js"></script>
	<script src="<%=basePath %>js/sign-up.js"></script>
	<script src="<%=basePath %>js/jquery.adipoli.min.js"></script>
	<script src="<%=basePath %>js/gbin1.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/iterms.css" />
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/adipoli.css" />
<script type="text/javascript">
$(function() {
	 var maxWidth = 160;  
     var maxHeight = 160;
     var curWidth  = $(".iterms img").width();  
     var curHeight = $(".iterms img").height();  
     if(curWidth > maxWidth){  
          $(".iterms img").width(maxWidth);  
     }  
     if(curHeight > maxHeight){  
          $(".iterms img").height(maxHeight);  
     }
});
</script>
</head>
<body>
	<div id="header">
		<div class="header-content">
			<h1 class="logo">
				<a href="<%=basePath %>jsp/index.jsp">photobucket</a>
			</h1>
			<a href="<%=basePath %>jsp/upload.jsp" class="nav-upload">上传</a>
			<form action="pictureAction!findByKeyWord" class="search" method="post">
				<div class="search-group">
					<input type="text" name="keyWord" class="field style" value="用户名、图片类别"/>
					<input type="hidden" name="page" value="1"/>
					<input type="submit" title="Submit" value="" class="submit" />
				</div>
			</form>
			<div class="login">
				<c:if test="${sessionScope.loginUser == null}">
					<div class="sign-in">
						<a href="javascript:void(0);">登录</a><a href="<%=basePath %>jsp/signup.jsp">注册</a>
					</div>
				</c:if>
				<c:if test="${sessionScope.loginUser != null}">
					<div class="show-user">
						<img src="<%=basePath %>${sessionScope.loginUser.photoSticker}" width="30" height="30"/>
						<a href="userAction!findById?user.id=${sessionScope.loginUser.id}">${sessionScope.loginUser.userName}</a>
					</div>
				</c:if>
				
				<div class="loginbox" style="display: none;">
					<span class="angle"></span>
					<a href="#" class="close">x</a>
					<form action="userAction!signin" class="login-form" method="post">
						<div class="input-group">
							<label for="username">用户名</label>
							<input type="text" name="user.userName" id="username" class="username" />
						</div>
						<div class="input-group">
							<label for="password">密码</label>
							<input type="password" name="user.password" id="password" class="password" />
						</div>
						<div class="input-group ">
							<input type="checkbox" name="checkbox" id="checkbox" class="checkbox"/>
							<small>记住我</small>
							<input type="submit" title="Login" value="登录" class="Login" />
						</div>
						<div class="login-info">
							<p>还没有登录账号？<a href="<%=basePath %>jsp/signup.jsp">立即注册</a></p>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div> <!-- header -->
	<div class="content">
		<div class="content2">
			<div class="main">
				<div class="main-content">
					<div class="para">
						<h2>Photography Styles</h2>
						<p>Get inspired from the latest photography techniques and more…</p>
					</div>
					<div class="toolbar">
						<ul>
							<li><a>${pageBean.currentPage }/${pageBean.totalPage }</a></li>
							<c:if test="${pageBean.currentPage != 1}">
								<li><a href="pictureAction!findAll?page=${pageBean.currentPage-1}">Prev</a></li>
							</c:if>
							<c:if test="${pageBean.currentPage != pageBean.totalPage }">
								<li><a href="pictureAction!findAll?page=${pageBean.currentPage+1}">Next</a></li>
							</c:if>
						</ul>
					</div>
					<div class="iterms">
						<c:forEach items="${pageBean.list}" var="picture">
							<a class="iterm" href="pictureAction!findById?picture.id=${picture.id }">
								<img src="<%=basePath %>${picture.url}" alt="${picture.picName }" class="adipoli"/>
							</a>
						</c:forEach>
					</div> <!-- iterms -->
				</div> <!-- main-content -->
			</div> <!-- main -->
			<div class="categories">
				<h5>便笺</h5>
				<ul>
					<li><a href="userAction!findById?user.id=${sessionScope.loginUser.id }">个人信息</a></li>
					<li><a href="<%=basePath %>jsp/upload.jsp">上传图片</a></li>
					<li><a href="pictureAction!findAll?page=1">所有图片</a></li>
					<c:if test="${sessionScope.loginUser != null}">
						<li><a href="userAction!logout">安全注销</a></li>
					</c:if>
				</ul>
			</div> <!-- categories -->
			<div class="whatisnew">
				<img src="../images/whatisnew.jpg" alt="whatisnew" />
				<div class="info">
					<h5>Edit Your Photos</h5>
					<p>Create all kinds of amazing special effects with our free, built-in image editor. Create color splash, cartoon, pop art effects, and much more!</p>
					<a href="#">Check it out</a>
				</div>
			</div> <!-- whatisnew --></div>
			<div class="toolbar">
						<ul>
							<li><a>${pageBean.currentPage }/${pageBean.totalPage }</a></li>
							<c:if test="${pageBean.currentPage != 1}">
								<li><a href="pictureAction!findAll?page=${pageBean.currentPage-1}">Prev</a></li>
							</c:if>
							<c:if test="${pageBean.currentPage != pageBean.totalPage }">
								<li><a href="pictureAction!findAll?page=${pageBean.currentPage+1}">Next</a></li>
							</c:if>
						</ul>
				</div>
	</div> <!-- contetn -->
	<div class="footer">
		<div class="footer-content">
			<p>Copyright 2012 Sharelife.  All rights reserved.  |   <a href="#">Privacy policy</a>  |   <a href="#">Terms of use</a>  |   <a href="#">Site map</a></p>
		</div>
	</div>
</body>
</html>